cmake_minimum_required (VERSION 2.8)

project(MultiDraw)

#set(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
#add_compile_options("-DCUDA_USE_STATIC_CUDA_RUNTIME=OFF")
#ADD_DEFINITIONS(-DCUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_BUILD_TYPE "Release")

if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g -Wall -Wno-unused-variable -pthread")
else( CMAKE_BUILD_TYPE STREQUAL "Debug" )
        set(CMAKE_BUILD_TYPE "Release")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -pthread -fopenmp")
endif( CMAKE_BUILD_TYPE STREQUAL "Debug" )

message("Build Type:" ${CMAKE_BUILD_TYPE} ${CMAKE_CXX_FLAGS})

##################################################
# OpenCV
##################################################
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
# If the package has been found, several variables will
# be set, you can find the full list with descriptions
# in the OpenCVConfig.cmake file.
# Print some message showing some of them
message(STATUS "OpenCV library status:")
message(STATUS "    version: ${OpenCV_VERSION}")
message(STATUS "    libraries: ${OpenCV_LIBS}")
message(STATUS "    include path: ${OpenCV_INCLUDE_DIRS}")
##################################################
# Qt5
##################################################
# Find the QtWidgets library  
find_package(Qt5Widgets) 
find_package(Qt5Core)  
include_directories(${QT_USE_FILE})

#find_package(Qt5 REQUIRED)

#message(STATUS "OpenCV library status:")
#message(STATUS "    version: ${QT_VERSION}")
#message(STATUS "    libraries: ${QT_LIBS}")
#message(STATUS "    include path: ${QT_INCLUDE_DIRS}")

set(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_AUTOMOC ON) 
aux_source_directory(${PROJECT_SOURCE_DIR}/src SOURECE_SRC)

add_executable(Draw ${SOURECE_SRC})
target_link_libraries(Draw ${Qt5Widgets_LIBRARIES} ${Qt5Core_LIBRARIES})
target_link_libraries(Draw ${OpenCV_LIBRARIES})
